package mtons.cast.modules.controller;

import mtons.cast.modules.data.Result;
import mtons.cast.modules.persist.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by langhsu on 2017/10/13.
 */
@Controller
@RequestMapping("/account")
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping("/info")
    @ResponseBody
    public Result info(String username) {
        return Result.success(accountService.findByUsername(username));
    }

}
